package handlers;

import main.MainMap;
import main.MainMenu;
import constants.GeneralConstants;
import people.Character;
import handlers.JobHandler;

public class LevelUpHandler extends GeneralConstants {

	public static void handle(Character c) {
		c.level = c.level + 1;
		int[] growths = JobHandler.getGrowths(c);
		for (int x = 0; x < 6; x++) {
			c.stats[x] = c.stats[x] + growths[x];
		}
		c.health = c.stats[0];
		c.mana = c.stats[1];
		c.exp = 0;
		switch (c.level) {
		case 10: 
			MainMenu.printInfo("Congratulations " + Character.name + ". You have completed the Adventures of Adventure Land !!!!");
			break;
		default:
			MainMenu.printInfo("Congratulations, you have leveled up to level "
					+ c.level);
			break;
		}
		MainMap.stats.recalcStats();
	}
}